library(tidyverse)

source("scripts/clean_study1.R")
source("scripts/clean_study2.R")
source("scripts/clean_study3.R")
source("scripts/clean_study4.R")
source("scripts/clean_study5.R")

study2 <- combined_df
study4 <- study4_coded
study5 <- study5_coded

pre_control <- rbind(
  study1 %>%
    dplyr::select(pre_attitudes, pre_certainty) %>%
    mutate(multi_item = NA, pw2p_scale = NA, pw2p_defend = NA, treatment = NA, study = "Study 1", n = n()) %>%
    rename(strength = pre_attitudes, certainty = pre_certainty),
  study2 %>%
    filter(condition=="strong") %>%
    dplyr::select(pre_attitudes, pre_certainty, pre_certain_scores) %>%
    mutate(pw2p_scale = NA, pw2p_defend = NA, treatment = NA, study = "Study 2", n = n()) %>%
    rename(strength = pre_attitudes, certainty = pre_certainty, multi_item = pre_certain_scores),
  study3 %>%
    dplyr::select(post_outcome_1, post_certainty_19, post_certain_scores, treatment) %>%
    mutate(pw2p_scale = NA, pw2p_defend = NA, study = "Study 3", n = n()) %>%
    rename(strength = post_outcome_1, certainty = post_certainty_19, multi_item = post_certain_scores),
  study4 %>%
    dplyr::select(likert, certainty, pw2p_scale, pw2p_defend, treatment) %>%
    mutate(multi_item = NA, study = "Study 4", n = n()) %>%
    rename(strength = likert),
  study5 %>%
    dplyr::select(likert, certainty, pw2p_scale, pw2p_defend, treatment) %>%
    mutate(multi_item = NA, study = "Study 5", n = n()) %>%
    rename(strength = likert)
)

theme_params <-  theme(panel.background = element_rect(fill = 'gray95'),
                       panel.grid.minor = element_blank(),
                       panel.grid.major = element_blank(),
                       legend.text = element_text(size = 15),
                       axis.text.x = element_text(size = 15),
                       legend.title=element_blank(),
                       axis.text.y = element_text(size = 15),
                       axis.title.y = element_text(size = 15),
                       axis.title.x = element_text(size = 15),
                       legend.position = "bottom",
                       plot.margin = unit(c(.25,.25,.25,.25), "cm"),
                       strip.text.x = element_text(size = 15))
